import { createRouter, createWebHistory } from 'vue-router'
import { basicRoutes } from '@/router/basic-routes.ts'
import { setupRouterGuards } from '@/router/guards'
import { App } from 'vue'

export const router = createRouter({
  history: createWebHistory('/'),
  routes: basicRoutes,
  scrollBehavior: () => ({ left: 0, top: 0 }),
})

export async function setupRouter(app: App): Promise<void> {
  app.use(router)
  setupRouterGuards(router)
}
